
<template>
  <div>
      <el-radio-group v-model="radio_defaultValue" :placeholder="fieldArguments.desc"
      @change="onChange">
        <el-radio v-for='(item,index) in optionsData' :label="item[field.defaultProps.value]">{{item[field.defaultProps.label]}}</el-radio>
      </el-radio-group>
  </div>
</template>

<script>
  
  import Common from './js/Common'
  export default {
    name: 'sls-radio',
    mixins:[Common],
    data () {
      return {
        radio_defaultValue:''
      }
    },
    created () {
      console.log('sdfadfadsfadsf')
      this.radio_defaultValue = this.defaultValue;
    },
    computed: {
      select_attrs () {
        return this.fieldArguments.select_attrs || {}
      },
    
      optionsData () {
        return this.optionData
      }
    },
    watch:{
      optionData(){
    
      },
      defaultValue(){
    
        this.radio_defaultValue = this.defaultValue;
      },
    
    },
    methods: {
      onChange (v) {
        //this.submit_info[this.data.key] = '';
        //this.submit_info[this.data.key] = this.temp_field_obj[this.data.key][v];
        //this.events.change && this.events.change({value: v, info: this.submit_info[this.data.key]});
        this.$emit('onChange', [this.data.key,v]);
      }
    }
  }
  
</script>
